<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="utf-8">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <link rel="shortcut icon" type="image/x-icon" href="/static/img/favicon.png"/>
    <!-- BOOTSTRAP STYLES-->
    <link href="//cdn.bootcss.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet"/>
    <title>登录-学习记录</title>
    <style>
        .modal-footer {
            border-top: 0;
        }
    </style>
</head>
<body>

<!--login modal-->
<div id="loginModal" class="modal show" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <h1 class="text-center">登录</h1>
            </div>
            <div class="modal-body">
                <form class="form col-md-12 center-block" action="" method="post">
                    {{ form.hidden_tag() }}
                    <div class="form-group">
                        <input name="email" value="{{ form.email.data }}" type="text"
                               class="form-control input-lg" placeholder="Email">
                    </div>
                    <div class="form-group">
                        <input name="password" type="password" class="form-control input-lg"
                               placeholder="Password">
                    </div>
                    <div class="form-group">
                        <div class="checkbox">
                            <label>
                                <input type="checkbox" name="remember_me"> 记住我？
                            </label>
                        </div>
                    </div>
                    <div class="form-group">
                        <button class="btn btn-primary btn-lg btn-block" type="submit">登录</button>
                    </div>
                    {% if (form.email.errors or form.password.errors or get_flashed_messages()) %}
                        <div class="form-group">
                            <div class="alert alert-warning alert-dismissible fade in" role="alert">
                                <button type="button" class="close" data-dismiss="alert"
                                        aria-label="Close">
                                    <span aria-hidden="true">×</span>
                                </button>
                                {% for error in form.email.errors %}
                                    * {{ error }}<br/>
                                {% endfor %}
                                {% for error in form.password.errors %}
                                    * {{ error }}<br/>
                                {% endfor %}
                                {% for message in get_flashed_messages() %}
                                    * {{ message }}
                                {% endfor %}

                            </div>
                        </div>
                    {% endif %}
                </form>
            </div>
            <div class="modal-footer">
            </div>
        </div>
    </div>
</div>

<!-- JQUERY SCRIPTS -->
<script src="//cdn.bootcss.com/jquery/1.10.2/jquery.min.js"></script>
<!-- BOOTSTRAP SCRIPTS -->
<script src="//cdn.bootcss.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>

<script>
    $(function () {
        $('.alert').stop(true).animate({
            "opacity": "hide"
        }, 4000);
    });
</script>
</body>
</html>